/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package servlet;

import com.google.gson.Gson;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet("/compute")
public class Compute extends HttpServlet{

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        int count=Integer.parseInt(req.getParameter("count"));
        resp.setContentType("application/x-json;charset=utf-8");
        Gson gson=new Gson();
        String jsonObject=gson.toJson(count);
        resp.getWriter().println(jsonObject);
    }
    
}
